﻿using SmartHRMS.Model.Account;
using StructureMap;
using System.Collections.Generic;

namespace SmartHRMS.Presentation.Account
{
    public class ModuleListPresenter
    {
        private IModuleListView view;
        private IModuleService moduleService;

        public ModuleListPresenter(IModuleListView view)
        : this(ObjectFactory.GetInstance<IModuleService>(), view)
        {
        }

        public ModuleListPresenter(IModuleService moduleService, IModuleListView view)
        {
            this.view = view;
            this.moduleService = moduleService;
        }

        public void Display()
        {
            IList<Module> allModules;

            allModules = moduleService.FindAll();

            this.view.Module = allModules;
        }
    }
}
